<template>
  <div class="recommend">
    <div class="recommend-title">热销推荐</div>
    <ul>
      <router-link tag="li" :to="'/detail/' + recommend.id" class="recommend-item border-bottom" v-for="recommend in list" :key="recommend.id">
          <img class="img-wrap" :src="recommend.imgUrl" alt="">
          <div class="item-info">
            <p class="item-title">{{recommend.title}}</p>
            <p class="item-desc">{{recommend.desc}}</p>
            <button class="item-button">查看详细</button>
          </div>
      </router-link>
    </ul>
  </div>
</template>
<script>
export default {
  name: "Recommend",
  data() {
    return {};
  },
  props: {
    list: Array
  }
};
</script>
<style lang="scss" scoped>
.recommend {
  .recommend-title {
    background-color: #eee;
    line-height: 0.8rem;
    text-indent: 2em;
  }
  .recommend-item {
    display: flex;
    overflow: hidden;
    height: 1.9rem;
    .img-wrap {
      width: 1.7rem;
      height: 1.7rem;
      padding: 0.1rem;
    }
    .item-info {
      flex: 1;
      padding: 0.1rem;
      min-width: 0;
      .item-title {
        line-height: 0.54rem;
        font-size: 0.32rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .item-desc {
        line-height: 0.4rem;
        color: #ccc;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .item-button {
        background: #ff9300;
        padding: 0 0.2rem;
        border-radius: 0.06rem;
        margin-top: 0.2rem;
        color: #fff;
        line-height: 0.45rem;
      }
    }
  }
}
</style>
